﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using KMFrame.Permission.Util;
using LGCourt.Logic.BLL;

namespace lgweb.lawyer
{
    public partial class index : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!SessionBox.CheckUserSession())
            {
                Response.Redirect("/user/login.aspx");
            }

            if (!this.IsPostBack)
            {
                GetGetWSTZTop();
                GetMyRebackTop();
                GetMyCaseTop();
            }
        }

        /// <summary>
        /// 获取文书与通知
        /// </summary>
        private void GetGetWSTZTop()
        {
            Lawyer bll = new Lawyer();

            int _userID = SessionBox.GetUserSession().UserID;

            List<WSTZItem> result = (List<WSTZItem>)bll.GetWSTZTop(_userID);

            if (result != null)
            {
                this.rptWSTZTop.DataSource = result;
                this.rptWSTZTop.DataBind();
            }
        }

        /// <summary>
        /// 获取申请与回复
        /// </summary>
        private void GetMyRebackTop()
        {
            Lawyer bll = new Lawyer();

            int _userID = SessionBox.GetUserSession().UserID;

            List<MyRebackItem> result = (List<MyRebackItem>)bll.GetMyRebackTop(_userID);

            if (result != null)
            {
                this.rptMyReback.DataSource = result;
                this.rptMyReback.DataBind();
            }
        }

        /// <summary>
        /// 获取我的案件
        /// </summary>
        private void GetMyCaseTop()
        {
            Lawyer bll = new Lawyer();

            int _userID = SessionBox.GetUserSession().UserID;

            List<MyCaseItem> result = (List<MyCaseItem>)bll.GetMyCaseTop(_userID);

            if (result != null)
            {
                this.rptMyCase.DataSource = result;
                this.rptMyCase.DataBind();
            }
        }


    }
}